/*------------------------------------------------------------------------------
 * TObject.java - Transaction Object Interface.  A TObject is a basic object 
 * that a TransactionManager monitors.  It is able to transform itself to a
 * previous/future state by subtracting/adding (rpatch/patch) diffs onto itself
 * 
 * September 2009, Forhad Ahmed
 *------------------------------------------------------------------------------
 */

package transaction;

import schematic.SObject;
import schematic.Schematic;

public interface TObject {
    
    /*
     * Given an original/modified object, calculate the difference and save it
     * in 'this' checkpointed object and use 'this' as part of the diff vector
     */
    public SObject diff(Object object);
    
    
    /*
     * Reverse patch a diff object (undo)
     */
    public void rpatch(Object object, Object context);
    
    
    /*
     * Forward patch a diff object (redo)
     */
    public void patch(Object object, Object context);
    
    
    // checkpoint(context, action)

}
